package com.yiyahui.project.erp.service.impl;

import java.util.List;
import com.yiyahui.common.utils.DateUtils;
import com.yiyahui.project.erp.domain.requestVo.YiyaVisitDoctorRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.yiyahui.project.erp.mapper.YiyaVisitDoctorMapper;
import com.yiyahui.project.erp.domain.YiyaVisitDoctor;
import com.yiyahui.project.erp.service.IYiyaVisitDoctorService;

/**
 * 医生回访Service业务层处理
 * 
 * @author yiyahui
 * @date 2020-05-08
 */
@Service
public class YiyaVisitDoctorServiceImpl implements IYiyaVisitDoctorService 
{
    @Autowired
    private YiyaVisitDoctorMapper yiyaVisitDoctorMapper;

    /**
     * 查询医生回访
     * 
     * @param id 医生回访ID
     * @return 医生回访
     */
    @Override
    public YiyaVisitDoctor selectYiyaVisitDoctorById(Long id)
    {
        return yiyaVisitDoctorMapper.selectYiyaVisitDoctorById(id);
    }

    /**
     * 查询医生回访列表
     * 
     * @param yiyaVisitDoctorRequest 医生回访
     * @return 医生回访
     */
    @Override
    public List<YiyaVisitDoctor> selectYiyaVisitDoctorList(YiyaVisitDoctorRequest yiyaVisitDoctorRequest)
    {
        return yiyaVisitDoctorMapper.selectYiyaVisitDoctorList(yiyaVisitDoctorRequest);
    }

    /**
     * 新增医生回访
     * 
     * @param yiyaVisitDoctor 医生回访
     * @return 结果
     */
    @Override
    public int insertYiyaVisitDoctor(YiyaVisitDoctor yiyaVisitDoctor)
    {
        yiyaVisitDoctor.setCreateTime(DateUtils.getNowDate());
        return yiyaVisitDoctorMapper.insertYiyaVisitDoctor(yiyaVisitDoctor);
    }

    /**
     * 修改医生回访
     * 
     * @param yiyaVisitDoctor 医生回访
     * @return 结果
     */
    @Override
    public int updateYiyaVisitDoctor(YiyaVisitDoctor yiyaVisitDoctor)
    {
        yiyaVisitDoctor.setUpdateTime(DateUtils.getNowDate());
        return yiyaVisitDoctorMapper.updateYiyaVisitDoctor(yiyaVisitDoctor);
    }

    /**
     * 批量删除医生回访
     * 
     * @param ids 需要删除的医生回访ID
     * @return 结果
     */
    @Override
    public int deleteYiyaVisitDoctorByIds(Long[] ids)
    {
        return yiyaVisitDoctorMapper.deleteYiyaVisitDoctorByIds(ids);
    }

    /**
     * 删除医生回访信息
     * 
     * @param id 医生回访ID
     * @return 结果
     */
    @Override
    public int deleteYiyaVisitDoctorById(Long id)
    {
        return yiyaVisitDoctorMapper.deleteYiyaVisitDoctorById(id);
    }
}
